class CardUtil {
    constructor() {
        this.cardMap = {
            'zjh_12_5': 0, 
            'zjh_24_5': 0, 
            'fkniuniu17_12_6': 1, 
            'fkniuniu17_24_6': 2, 
            'fkniuniu17_12_10': 2, 
            'fkniuniu17_24_10': 4, 
            'fkniuniu17_12_13': 3, 
            'fkniuniu17_24_13': 6, 
            'fkniuniu17_12_15': 4, 
            'fkniuniu17_24_15': 7, 
            'fkniuniu17_12_17': 5, 
            'fkniuniu17_24_17': 8, 
            'fkbj_12_5': 0,
            'fkbj_24_5': 0,
            'fkdz_12_6': 0,
            'fkdz_24_6': 0,
            'fkmj_4_4': 2,
            'fkmj_8_4': 4,
            'fkmj_12_4': 6,
            'fkmj_16_4': 8,
            'fkpj_12_8': 3,
            'fkpj_24_8': 6,
            'fkzjh_12_6': 1,
            'fkzjh_12_9': 1,
            'fkzjh_12_12': 1,
            'fkzjh_12_17': 2,
            'fkzjh_24_6': 2,
            'fkzjh_24_9': 2,
            'fkzjh_24_12': 3,
            'fkzjh_24_17': 4,
            'fk_cymj_4_4': 2,
            'fk_cymj_8_4': 4,
            'fk_cymj_12_4': 6,
            'fk_cymj_16_4': 8,
        };
    }

    /**
     * 
     * @param {String} gameType 
     * @param {Number} turnOfGame 
     * @param {Number} playerNum 
     * @returns {Number}
     */
    calcCard(gameType, turnOfGame, playerNum){
        let key = gameType + "_" + turnOfGame;
        if(playerNum){
            key += "_" + playerNum;
        }

        let res = this.cardMap[key];
        if(!res){
            return 0;
        }

        return res;
    }
}

let cardUtil = new CardUtil();
module.exports = cardUtil;